package constant

import "git.bybit.com/svc/stub/pkg/pb/enums/ekycadmin"

type BusinessID string

const (
	BusinessTypeGlobal   BusinessID = "global"
	BusinessTypeCard     BusinessID = "card"
	BusinessTypeNft      BusinessID = "nft"
	BusinessTypeFaas     BusinessID = "faas"
	BusinessTypOnlychain BusinessID = "onlychain"
	BusinessTypNarkasa   BusinessID = "narkasa"
)

func GetBusinessID(n string) BusinessID {
	if n == "" {
		return BusinessTypeGlobal
	}
	return BusinessID(n)
}

func (b BusinessID) String() string {
	return string(b)
}

// ToKYCBusinessID 转换为KYC业务类型
func (b BusinessID) ToKYCBusinessID() ekycadmin.KYCBusinessID {
	switch b {
	case BusinessTypeGlobal:
		return ekycadmin.KYCBusinessID_BUSINESS_ID_GLOBAL
	case BusinessTypeCard:
		return ekycadmin.KYCBusinessID_BUSINESS_ID_CARD
	case BusinessTypeNft:
		return ekycadmin.KYCBusinessID_BUSINESS_ID_NFT
	case BusinessTypeFaas:
		return ekycadmin.KYCBusinessID_BUSINESS_ID_FAAS
	case BusinessTypOnlychain:
		return ekycadmin.KYCBusinessID_BUSINESS_ID_ONLYCHAIN
	case BusinessTypNarkasa:
		return ekycadmin.KYCBusinessID_BUSINESS_ID_NARKASA
	default:
		return ekycadmin.KYCBusinessID_BUSINESS_ID_GLOBAL
	}
}

// KYCProvider provider types
type KYCProvider int

const (
	ProviderUnknown KYCProvider = 0
	ProviderSumSub  KYCProvider = 1
	ProviderJumio   KYCProvider = 2
	ProviderOnfido  KYCProvider = 3
)

// KYCLevel KYC level types
type KYCLevel int

const (
	KYCLevelUnknown KYCLevel = iota
	KYCLevel1                // KYC Level1等级
	KYCLevel2                // KYC Level2等级
)

// KYCState State
type KYCState int

const (
	KYCStateInit     KYCState = iota // init
	KYCStatePending                  // pending
	KYCStateComplete                 // complete
	KYCStateReset                    // reset
)

// KYCVerificationType KYC workflow state types
type KYCVerificationType int

const (
	KYCVerificationOnboarding KYCVerificationType = iota //
	KYCVerificationSupplement                            // 补充认证
)

func (v KYCVerificationType) IsOnboarding() bool {
	return v == KYCVerificationOnboarding
}

func (v KYCVerificationType) IsSupplement() bool {
	return v == KYCVerificationSupplement
}

// KYCDecision KYC 终审结果
type KYCDecision int

const (
	KYCDecisionUnknown KYCDecision = iota // 未知
	KYCDecisionSuccess                    // 通过
	KYCDecisionReject                     // 拒绝
)

// KYCAction 动作状态(0:ticket, 1:init, 2:pending, 3:complete, 4:reset)
type KYCAction int

const (
	KYCActionTicket   KYCAction = iota // ticket
	KYCActionInit                      // init
	KYCActionPending                   // pending
	KYCActionComplete                  // complete
	KYCActionReset                     // reset
)

// KYCDocType 证件类型
type KYCDocType int

const (
	UndefinedDocType KYCDocType = iota
	ID                          // ID Card
	Passport                    // Passport
	DrivingLicense              // Driver License
	LivingPermits               // Residence Permit
	Bill                        // Bill
	DocTypeCC                   // Jumio 专用
	DocTypeBS                   // Jumio 专用
	DocTypeIC                   // Jumio 专用
	DocTypeUB                   // Jumio 专用
	DocTypeCAAP                 // Jumio 专用
	DocTypeCRC                  // Jumio 专用
	DocTypeCCS                  // Jumio 专用
	DocTypeLAG                  // Jumio 专用
	DocTypeLOAP                 // Jumio 专用
	DocTypeMOAP                 // Jumio 专用
	DocTypeTR                   // Jumio 专用
	DocTypeVT                   // Jumio 专用
	DocTypeVC                   // Jumio 专用
	DocTypeSTUC                 // Jumio 专用
	DocTypeHCC                  // Jumio 专用
	DocTypeCB                   // Jumio 专用
	DocTypeSENC                 // Jumio 专用
	DocTypeMEDC                 // Jumio 专用
	DocTypeBC                   // Jumio 专用
	DocTypeWWCC                 // Jumio 专用
	DocTypeSS                   // Jumio 专用
	DocTypeTAC                  // Jumio 专用
	DocTypeSEL                  // Jumio 专用
	DocTypePB                   // Jumio 专用
	DocTypeSSC                  // Jumio 专用
	DocTypeCUSTOM               // Jumio 专用
	DocTypeOTHER                // Jumio 专用
	BVN                         // BVN
)

// KYCDocumentType 证件类型
type KYCDocumentType string

const (
	DocumentTypeUnknown   KYCDocumentType = "unknown"
	DocumentTypeID        KYCDocumentType = "id_card"
	DocumentTypePassport  KYCDocumentType = "passport"
	DocumentTypeDriver    KYCDocumentType = "driver"
	DocumentTypeResidence KYCDocumentType = "residence"
	DocumentTypeSelfie    KYCDocumentType = "selfie"
	DocumentTypeBank      KYCDocumentType = "bank_card"
	DocumentTypeBill      KYCDocumentType = "bill"
	DocumentTypeBVN       KYCDocumentType = "BVN"
)

// KYCTransfer KYC转移标记
type KYCTransfer int

const (
	KYCTransferNone KYCTransfer = iota // 非转移
	KYCTransferIn                      // 转入
	KYCTransferOut                     // 转出
)

type KYCImgType int

const (
	KYCImgTypeFront    KYCImgType = iota // 证件正面
	KYCImgTypeBack                       // 证件反面
	KYCImgTypeSelfie                     //	自拍照
	KYCImgTypeLiveness                   // 活体照
)

// KYCImgStatus 证件图片状态(0:init;1:complete;2:fail)
type KYCImgStatus int

const (
	KYCImgStatusInit     KYCImgStatus = iota // init
	KYCImgStatusComplete                     // complete
	KYCImgStatusFail                         // fail
)

const OnfidoNameNull = "NULL"
const OnfidoNameNullReplace = ""
